//vuex
import store from '../store/index.js'
import http from "../utility/request.js";

// const baseUrl = process.env.NODE_ENV === 'development' ? 'http://www.qsxz.demos.cn.vc/' : 'http://api.relaverse.cn/'
// const baseUrl = process.env.NODE_ENV === 'development' ? 'http://test.qsxz.relaverse.cn/' : 'http://api.relaverse.cn/'
const baseUrl = process.env.NODE_ENV === 'development' ? 'https://api.relaverse.cn/' : 'https://api.relaverse.cn/'
// const baseUrl = process.env.NODE_ENV === 'development' ? 'http://test.qsxz.relaverse.cn/' : 'http://test.qsxz.relaverse.cn/'
// const baseUrl = process.env.NODE_ENV === 'development' ? 'http://easy-town.test.canghua.cc/' : 'http://easy-town.test.canghua.cc/'
// 道具维修  旧
export const repair = (params) => http.post(`api/v1.Props/repair`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 蓝牙维修  新
export const buy_durable = (params) => http.post(`api/v1.Props/buy_durable`, {
	data: {
		acctoken: store.state.collectionToken, 
		...params
	},
	baseUrl
});

// 蓝牙道具详情
export const detailsr = (params) => http.post(`api/v1.Props/details`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 蓝牙道具升级
export const upgrade = (params) => http.post(`api/v1.Props/upgrade`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 道具第一次激活
export const massageActivation = (params) => http.post(`api/v1.hardware/massageActivation`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 道具列表
export const deviceListApi = (params) => http.get(`api/v1.Props/propsList`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 公用配置
export const getConfigApi = (params) => http.post(`index/member/configure`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 道具轮播图
export const banner = (params) => http.post(`api/v1.Props/banner`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 道具筛选
export const filters = (params) => http.post(`api/v1.Props/filters`, {
	data: {
		acctoken: store.state.collectionToken
	},
	baseUrl
});


// 使用准备
export const massageReady = (params) => http.post(`api/v1.hardware/massageReady`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 使用中产出元气
export const massageRun = (params) => http.post(`api/v1.hardware/massageRun`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 使用结束
export const massageEnd = (params) => http.post(`api/v1.hardware/massageEnd`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 使用记录
export const massageRecord = (params) => http.get(`api/v1.hardware/massageRecord`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 使用暂停
export const massagePause = (params) => http.post(`api/v1.hardware/massagePause`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 休眠使用列表
export const dormancyMassage = (params) => http.get(`api/v1.hardware/dormancyMassage`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 使用开始
export const massageStart = (params) => http.post(`api/v1.hardware/massageStart`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 使用异常结束
export const massageDetails = (params) => http.post(`api/v1.hardware/massageDetails`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 兑换记录
export const code_log = (params) => http.post(`index/Points/code_log`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 兑换硬件道具
export const redemptionCodeHardware = (params) => http.post(`index/redemption_Code/redemptionCodeHardware`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 兑换硬件道具配置文件
export const exchange_background_image = (params) => http.post(`api/v1.Props/exchange_background_image`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});

// 订单号续期
export const renewal = (params) => http.post(`/api/v1.props/renewal`, {
	data: {
		acctoken: store.state.collectionToken,
		...params
	},
	baseUrl
});